/**
 * @param {number[]} nums
 * @param {number[][]} operations
 * @return {number[]}
 */
var arrayChange = function(nums, operations) {
  for(let i = 0; i < operations.length; i++) {
    const index = nums.indexOf(operations[i][0]);
    nums[index] = operations[i][1];
  }
  return nums;
};
// let nums = [1,2,4,6], operations = [[1,3],[4,7],[6,1]];
// console.log(arrayChange(nums, operations));
// nums = [1,2], operations = [[1,3],[2,1],[3,2]];
// console.log(arrayChange(nums, operations));

let arr = [1, 2, 3, 4, 5, 6, 7];
console.log(arr.slice(0, 1));
console.log(arr.slice(1, 5));
console.log(arr.slice(5, 7));
